﻿<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Web报表(B/S报表)演示 - 自定义报表导出行为，在事件中改变导出选项，调整默认导出行为</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<script src="../CreateControl.js" type="text/javascript"></script>
	<script type="text/javascript">
//创建报表对象，并定义事件属性
CreateReport("Report", "<param name='OnExportBegin' value='OnExportBegin'>" 
    + "<param name='OnExportEnd' value='OnExportEnd'>" );

function window_onload() {
    var Report = document.getElementById("Report");
    
    ReportViewer.AttachReport(Report); //报表显示器与外部的报表对象关联

    ReportViewer.Start();
}

function OnExportBegin(OptionObject) 
{
    if (OptionObject.ExportType == 1) //gretXLS	
    {
        Report.DetailGrid.ColumnTitle.RepeatStyle = 1; //grrsNone
  
        var E2XLSOption = OptionObject.AsE2XLSOption;  //AsE2XLSOption是必须的
        E2XLSOption.SameAsPrint = false; 
        E2XLSOption.ExportPageHeaderFooter = false; 
        E2XLSOption.ExportPageBreak = false; 
    }
}

function OnExportEnd(OptionObject)
{
    Report.DetailGrid.ColumnTitle.RepeatStyle = 2; //grrsOnPage
}
	</script>
    <style type="text/css">
        html,body {
            margin:0;
            height:100%;
        }
    </style>
</head>
<body style="margin:0" onload="window_onload()">
<script type="text/javascript"> 
    CreatePrintViewerEx("100%", "100%", "../../../grf/1a.grf", "../../../data/DataCenter.jsp?data=Customer", false, "");
    //CreateDisplayViewerEx("100%", "100%", "../../../grf/1a.grf", "../../../data/DataCenter.jsp?data=Customer", false, "");
</script>
</body>
</html>